<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title> race </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
    <?php htmlhead(); ?>
  </head>
  
  <body>
    
    <div class="navTool menuborder">
      <div class="panel">
      <form method="post" action="?act=race_add" name="myform" id="myform" class="myform">
        <dl>
          <dt>种族名称</dt>
          <dd><input type="text" name="race_name" value="" /></dd>
        </dl>
        <dl>
          <dt>英文名称</dt>
          <dd><input type="text" name="race_en" value="" /></dd>
        </dl>
        <dl>
          <dt>种族颜色</dt>
          <dd><input type="text" name="race_color" value="" /></dd>
        </dl>
        <dl>
          <dt>种族图片</dt>
          <dd><input type="text" name="race_pic" value="" /></dd>
        </dl>
        <dl>
          <dt></dt>
          <dd><input type="submit" value="新增" class="btn" /></dd>
        </dl>
      </form>
      </div>
    </div>
    
    <table class="table">
      <thead>
        <tr>
          <th style="width:30px;">图标</th>
          <th style="width:auto;">种族名称</th>
          <th style="width:100px;">英文名称</th>
          <th style="width:136px;">文字颜色</th>
          <th style="width:128px;">操作</th>
        </tr>        
      </thead>
      <tbody>    
      <?php
        foreach($data as $_=>$v) {
          echo('<tr id="'.$v['race_id'].'">');
          echo('  <td>');
            if($v['race_pic']) echo('<img src="..'.$v['race_pic'].'" height="18" />');
          echo('  </td>');
          echo('  <td>');
            if($v['race_color']) echo('<span style="font-weight:bold;color:'.$v['race_color'].';">'.$v['race_name'].'</span>');
            else echo($v['race_name']);
          echo('  </td>');
          echo('  <td>'.$v['race_en'].'　</td>');
          echo('  <td>'.$v['race_color'].'　</td>');
          echo('  <td>');
          echo('    <span class="acticon actedit"><a href="?view=race_edit&id='.$v['race_id'].'">修改</a></span>');
          echo('    <span class="acticon actrecycle"><a onclick="return confirm(\'确定删除?\');" href="?act=race_delete&id='.$v['race_id'].'">删除</a></span>');
          echo('  </td>');
          echo('</tr>');
        }
      ?>
      </tbody>
    </table>
    
    <script>
      $(document).ready(function(){
        $(".table tr").hover(function() {
          if ($(this).hasClass('trhover'))
            $(this).removeClass('trhover');
          else
            $(this).addClass('trhover');          
        });
      });
    </script>
    
    <script>
    <?php echo getTips(); ?>
    </script>
    
</body>
</html>